home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d7 / lib231.arc / INET-OFF.SLT < prev    next >
Text File  |  1990-05-11  |  2KB  |  67 lines

  1. //////////////////////////////// INET-OFF.SLT /////////////////////////////////
  2. //
  3. //  INET-OFF.SLT Copyright (C) 1989-90 Liberation Enterprises.
  4. //
  5. //  DESCRIPTION:  This is a sample script which demonstrates the use of the
  6. //  Custom Logoff Script function, available in each Liberator Configuration.
  7. //  The Liberator will call the Custom Logoff Script when the 'Thanks for
  8. //  calling' message (also user-definable) is received from PCBoard.  Once the
  9. //  script completes, The Liberator will perform Qmail packet maintenance (if
  10. //  any is required), and reset the capture file, etc.  If you choose not to
  11. //  disconnect from PCBoard, the script will not be called.
  12. //
  13. //  INSTRUCTIONS:  Edit the inet_logoff_command and the delay if necessary,
  14. //  then type the name INET-OFF in the Custom Logoff Script option of any 
  15. //  Configuration (screen 1).  You must compile this script before use, by
  16. //  typing the command CS INET-OFF from DOS.
  17.  
  18. int d =                         5;        // response delay (10ths)
  19. str inet_logoff_command[] =    "BYE";
  20.  
  21. //
  22. //////////////////////////////////////////////////////////////////////////////
  23. main()
  24. {
  25.  int t1,
  26.      t2,
  27.      tmark,
  28.      stat;
  29.  
  30.  if (!carrier())
  31.   return(0);
  32.  
  33.  t1 = track("iNet command: ", 0);
  34.  t2 = track("DATAPAC: call cleared", 0);
  35.  
  36.  tmark = timer_start(1200);                 // 2 minutes
  37.  
  38.  while (!time_up(tmark) && carrier())
  39.   {
  40.    terminal();
  41.    stat = track_hit(0);
  42.    
  43.    if (stat == t1)                          // send iNet logoff
  44.     {
  45.      delay_scr(d);
  46.      cputs(inet_logoff_command);
  47.      cputc('^M');
  48.     }
  49.    
  50.    else if (stat == t2)                     // call cleared
  51.     {
  52.      delay_scr(20);
  53.      break;
  54.     }
  55.   }
  56.  
  57.  track_free(0);
  58.  timer_free(tmark);
  59.  
  60.  while(carrier())   // continue hanging up, until the connection is broken
  61.   {
  62.    hangup();
  63.    delay_scr(50);
  64.   }
  65. }
  66.  
  67. /////////////////////////////// End of file //////////////////////////////////